home *** CD-ROM | disk | FTP | other *** search
- /* get_dads.c - convert C pointer to 8088 segmented address */
- /* this implementation is appropriate for small memory model */
- #include "stdio.h"
- #include "cminor.h"
-
- word16 get_ds() ; /* returns the DS segment value */
- word16 get_cs() ; /* returns the CS segment value */
-
- int get_dads(p,pseg,poff) /* convert data pointer to seg. addr. */
- char *p ; /* pointer value */
- word16 *pseg ; /* place segment value here */
- word16 *poff ; /* place offset value here */
- {
- *pseg = get_ds() ;
- *poff = (word16) p ;
- }
-
-
- int get_fads(pfun,pseg,poff) /* convert fun. pointer to seg. adr. */
- int (*pfun) () ; /* pointer value */
- word16 *pseg ; /* place segment value here */
- word16 *poff ; /* place offset value here */
- {
- *pseg = get_cs() ;
- *poff = (word16) pfun ;
- }
-
-